﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;

namespace GTA
{
    public partial class FrmDateBox : BaseForm
    {
        #region Starting Form
        public FrmDateBox()
        {
            InitializeComponent();
        }
        #endregion

        #region Events
        private void cmdOK_Click(object sender, EventArgs e)
        {
            SelectDate();
        }
        private void FrmDateBox_FormClosing(object sender, FormClosingEventArgs e)
        {
            Cancel();
        }
        #endregion

        #region Methods
        private void SelectDate()
        {
            this.Tag = dtDate.Value;
            this.Close();
        }
        private void Cancel()
        {
            if (this.Tag == null)
                this.Tag = DateTime.MinValue;
        }
        #endregion
    }
}
